package objects 
{
	import flash.geom.Point;
	import objects.Enemy.EnemyOrc;
	import objects.Enemy.EnemyWulf;
	import starling.display.Sprite;
	import starling.events.Event;
	/**
	 * ...
	 * @author Tuan
	 */
	public class LoadEnemy extends Sprite
	{
		private var m_listEnemy : Array;
		
		
		public function LoadEnemy() 
		{
			
		   	this.addEventListener(Event.ADDED_TO_STAGE, init);
			
				//list enemy
			m_listEnemy = new Array();
			ManagerObject.Instance().setListEnemy (m_listEnemy);
			m_listEnemy =  ManagerObject.Instance().getListEnemy();
			
		}
		private function init(event:Event):void
		{	
			
		}
		public function pushEnemy( sprite:Sprite, pos : Point, path : Path, id : int) : void
		{
			if (id == 0)
			{
		      	m_listEnemy.push(new Enemy(sprite, pos,path, id));
			}
		    else if (id == 1)
			{
			    m_listEnemy.push(new SoliderChinese(sprite, pos,path, id));
			}
			else if (id == 2)
			{
				m_listEnemy.push(new EnemyOrc(sprite, pos, path, id));
			}
			else if (id == 3)
			{
				m_listEnemy.push(new EnemyWulf(sprite, pos, path, id));
			}
			
		}
		public function release (): void
		{
			m_listEnemy.length = 0;
		}

		
	}

}